

    <!-- 主体部分 -->
    <div class="layui-body " id="body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <blockquote class="layui-elem-quote layui-text">
                用户:
                <span class="layui-font-red">
                    {$uname}
                </span>

                ,欢迎使用<strong>博客管理系统</strong>
            </blockquote>
            <div class="layui-card layui-panel">
                <div class="layui-card-header">
                    <a class="layui-btn layui-btn-sm">文章</a>
                    <a class="layui-btn layui-btn-sm">下载</a>
                    <a class="layui-btn layui-btn-sm">问答</a>
                </div>
<!--                <div class="layui-text layui-main layui-font-14 font-margin ">-->
<!--                    <a class="">全部(123)</a>-->
<!--                    <a>全部可见(100)</a>-->
<!--                    <a>私人可见(100)</a>-->
<!--                    <a>审核(123)</a>-->
<!--                    <a>草稿箱(123)</a>-->
<!--                    <a>回收站(123)</a>-->
<!--                </div>-->
                <div class="layui-card-body">
                    <!-- 文章搜索盒子 -->
                    <form class="layui-form" action="/index.php/index/search" method="post">
                        <div class="layui-form-item">
                            <!-- 年 利用tp6 模板引擎使用 -->
                            <div class="layui-input-inline">
                                <select name="year">
                                    <option value="1" selected disabled>年</option>
                                    {for start="2012" end="2024"}
                                     <option value="{$i}">{$i}</option>
                                    {/for}
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="month">
                                    <option value="13" selected disabled>月</option>
                                    {for start="1" end="13"}
                                         <option value="{$i}">{$i}</option>
                                    {/for}
                                </select>
                            </div>
                            <!-- 文章类型 -->
                            <div class="layui-input-inline">
                                <select name="label">
                                    <option value="aa" selected disabled>文章标签</option>
                                    {foreach name="labelList" item="vo" key="k"}
                                        <option value="{$k}">{$k}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select name="col">
                                    <option value="bb" selected disabled>分类专栏</option>
                                    {foreach name="colList" item="vo" key="k"}
                                            <option value="{$k}" >{$k}</option>
                                    {/foreach}
                                </select>
                            </div>

                            <!-- 搜索框 根据文章标题模糊查询 -->

                            <div class="layui-input-inline">
                                <input type="text" name="title"  placeholder="请输入"
                                      class="layui-input">
                            </div>

                            <!-- 搜索按钮 -->
                            <div class="layui-input-inline">
                                <button type="submit" class="layui-btn layui-btn-normal" lay-submit
                                        lay-filter="search1">搜索</button>
                            </div>
                        </div>
                    </form>
                    <hr>
                    <div class="layui-fluid">
                        <!-- 文章盒子单个 -->
                        {volist name="atList" id="vo" key="k"}
                                <div class=" layui-row ">
                                    <div class="layui-col-md2 at-img" style="padding: 5px">
                                        <img src="__UPLOAD__/{$vo.image}" width="100%">
                                    </div >

                                    <div class="layui-col-md10">
                                        <div class="layui-row ">
                                            <div class=" layui-col-md10">
                                                <p class="layui-hide" id="atId" value="{$vo.id}">{$vo.id}</p>
                                                <span class="layui-font-18 "><a
                                                        href="">{$vo.title}</a>
                                                </span>
                                            </div>
                                            <div class="layui-col-md2">
                                                <span class="layui-font-12 ">{$vo.addTime}</span>
                                            </div>
                                            <div class="layui-col-md12">
                                                <p class="layui-font-14">
                                                    <span><br>文章标签:&nbsp;&nbsp;<span class="layui-font-orange">{$vo.labList}</span></span>
                                                </p>
                                            </div>
                                            <div class="layui-col-md9 " style="padding-top: 10px">
                                                <span>分类专栏:&nbsp;&nbsp;</span><span class="layui-font-14 layui-font-blue">{$vo.colList}</span>
                                            </div>
                                            <div class="layui-col-md3 " >
                                                 <span class="">
                                                     <br>
                                                        <a class="layui-btn layui-btn-sm" id="editAt" href="/index.php/index/editAt?id={$vo.id}">编辑</a>
                                                        <a class="layui-btn layui-btn-sm" id="lookAt" href="/index.php/index/lookAt?id={$vo.id}">浏览</a>
                                                        <a class="layui-btn layui-btn-sm" id="permissionChange">权限修改</a>
                                                        <p class="layui-hide" id="delId">id={$vo.id}</p>
                                                        <a class="layui-btn layui-btn-sm layui-btn-danger " id="moveAt{$i++}" title="{$vo.id}">删除</a>
                                                    </span>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                             <hr>
                        {/volist}

                        <hr>


                        <hr>
                        <!-- 分页 -->
                        <div class="page layui-laypage">
                            <span class="layui-laypage-count">共 {$count} 条,共 {$total} 页</span>
                            {for start="0" end="$total" step="1"}
                                <a class="layui-laypage-curr" href="http://localhost:8000/index.php/index/index?page={$i}">{$i}</a>
                            {/for}
                        </div>

                    </div>
                </div>
            </div>
            <br><br>
        </div>
    </div>



<script>
    // 权限修改提示
    $("#permissionChange").click(function(){
        layer.open({
            type: 1, // 页面层
            title: '权限修改',
            content: `
                
            <div class="layui-form" style="margin: 16px;">
                <div >
                    <div class="layui-form-item">
                        <div class="layui-input-wrap">
                            <div class="layui-input-prefix">
                                <i class="layui-icon layui-icon-username"></i>
                            </div>
                            <input type="text" name="username" value="" lay-verify="required" placeholder="用户名" lay-reqtext="请填写用户名" autocomplete="off" class="layui-input" lay-affix="clear">
                        </div>
                        
                    </div>   

                </div>
            </div>`,
            area: ['400px', '200px'],
            anim: 2
        });
    })


    // 添加文章事件
    function addAt() {
        window.location.href = "./addAt.html"
    }

    // 编辑跳转
    // $("#editAt").click(function () {
    //     window.location.href = "/index.php/index/editAt?id="+ $("#atId").html();
    // })

    // 查看跳转
    // $("#lookAt").click(function () {
    //     window.location.href="/index.php/index/lookAt";
    // })

    // 移动弹出层
    $("#moveAt13").click(function(){
        layer.confirm('确定要删除吗?',
            {btn: ['确定', '取消',],
                btn2:function (index,layero) {
                    layer.close(index);
                }
            }, function(index){
                // alert($("#moveAt13").attr("title"))
                window.location.href = "/index.php/index/delAt?id="+$("#moveAt13").attr("title");
                layer.close(index);
        });
    })
    $("#moveAt14").click(function(){
        layer.confirm('确定要删除吗?',
            {btn: ['确定', '取消',],
                btn2:function (index,layero) {
                    layer.close(index);
                }
            }, function(index){
                alert($("#moveAt14").attr("title"))
                // window.location.href = ;
                layer.close(index);
            });
    })
    $("#moveAt15").click(function(){
        layer.confirm('确定要删除吗?',
            {btn: ['确定', '取消',],
                btn2:function (index,layero) {
                    layer.close(index);
                }
            }, function(index){
                alert($("#moveAt15").attr("title"))
                // window.location.href = ;
                layer.close(index);
            });
    })
    $("#moveAt16").click(function(){
        layer.confirm('确定要删除吗?',
            {btn: ['确定', '取消',],
                btn2:function (index,layero) {
                    layer.close(index);
                }
            }, function(index){
                alert($("#moveAt16").attr("title"))
                // window.location.href = ;
                layer.close(index);
            });
    })
    $("#moveAt17").click(function(){
        layer.confirm('确定要删除吗?',
            {btn: ['确定', '取消',],
                btn2:function (index,layero) {
                    layer.close(index);
                }
            }, function(index){
                alert($("#moveAt17").attr("title"))
                // window.location.href = ;
                layer.close(index);
            });
    })
    // ajax是直接请求后端，然后返回一个参数
    // $.ajax({
    //     url:'./home.html',
    //     data:'1111',
    //     success:function(){
    //         layer.msg(1111)
    //     }
    // })

</script>


